package com.ruoyi.statisticalCenter.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.logistic.domain.PageInfo;
import com.ruoyi.statisticalCenter.domain.ScEnterPaiGrossProfitSheet;
import com.ruoyi.statisticalCenter.domain.ScOutPortWarehouseGrossProfitSheet;
import com.ruoyi.statisticalCenter.domain.vo.ScEnterPaiGrossProfitSheetVo;
import com.ruoyi.statisticalCenter.domain.vo.ScOutPortWareDispositionVo;
import com.ruoyi.statisticalCenter.domain.vo.ScOutPortWarehouseGrossProfitSheetVo;
import com.ruoyi.statisticalCenter.domain.vo.ScWeightFlowDirectionDispositionVo;
import com.ruoyi.statisticalCenter.service.ScEnterPaiGrossProfitSheetService;
import com.ruoyi.statisticalCenter.service.ScOutPortWarehouseGrossProfitSheetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sc/outPortWarehouseGrossProfitSheet")
@Api(tags = "统计中心-出港包仓毛利报表")
public class ScOutPortWarehouseGrossProfitSheetController {
    @Autowired
    private ScOutPortWarehouseGrossProfitSheetService scOutPortWarehouseGrossProfitSheetService;

    @ApiOperation("汇总")
    @PostMapping("/collect")
    public R collect(@RequestBody ScOutPortWarehouseGrossProfitSheetVo vo) {
        if (vo != null) {
            String startTime = vo.getStartTime().replace("-", "");
            String endTime = vo.getEndTime().replace("-", "");
            vo.setStartTime(startTime);
            vo.setEndTime(endTime);
        }

        return scOutPortWarehouseGrossProfitSheetService.collect(vo);

    }

    @PostMapping("/updateDisposition")
    @ApiOperation("修改配置参数")
    public R updateDisposition(@RequestBody ScOutPortWareDispositionVo vo)
    {
        return scOutPortWarehouseGrossProfitSheetService.updateDisposition(vo);
    }

    @GetMapping("/selectDisposition")
    @ApiOperation("查询配置参数")
    public R selectDisposition()
    {
        return scOutPortWarehouseGrossProfitSheetService.selectDisposition();
    }
}
